package com.linkhouse.controller;

import com.linkhouse.service.QueryOrederService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Component
@EnableScheduling
@RequestMapping("/jop")
@RestController
@Api("定时器接口文档")
public class TimerController {


    @Autowired
    private QueryOrederService queryOrederService;


    /*
    *查询离到期前3天
    * */
    //每天上午10 点触发
    @Scheduled(cron = "0 0/3 * * * ?")
    public void say(){
        queryOrederService.queryOreder();
    }

    /*
    * 房租逾期一天通知
    * */
    @Scheduled(cron = "0 0/3 * * * ?")
    public void say2(){
        queryOrederService.queryOreder2();
    }


}
